package com.jucai.pppeiyouclient.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Kuky on 2017-04-21.
 */

public abstract class BaseFragment extends Fragment implements View.OnClickListener {
    protected View itemView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        itemView = inflater.inflate(getFragmentViewId(), container, false);
        initView();
        initData();
        setListener();
        return itemView;
    }

    @Override
    public void onResume() {
        super.onResume();
        loadNetData();
    }

    protected abstract void initView();

    protected abstract void initData();

    protected abstract void loadNetData();

    protected abstract void setListener();

    protected abstract int getFragmentViewId();
}
